using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace VoxelEngine.TerrainGenerator
{
	[Serializable]
	public class TerrainGenerator : MonoBehaviour
	{
		[SerializeField]
		protected string _seed;

		[SerializeField]
		protected int _dirtHeight;

		[SerializeField]
		protected int _waterHeight;

		[SerializeField]
		protected bool _createProps = true;

		protected SimplexNoise3D _simplexNoise3D;

		protected Dictionary<VoxelProp.PropType, VoxelProp> _voxelProps;

		public string Seed => _seed;

		public virtual IEnumerator CreateWorldFromSeed(World world)
		{
			yield return null;
		}

		public virtual void CreateColumn(World world, int x, int y, int z, int surfaceHeight)
		{
		}

		public IEnumerator DrawProps(World world)
		{
			if (_createProps && _voxelProps != null)
			{
				UnityEngine.Debug.Log("Creating World Props");
				foreach (KeyValuePair<VoxelProp.PropType, VoxelProp> prop in _voxelProps)
				{
					UnityEngine.Debug.Log("Creating " + prop.Key);
					prop.Value.Draw(world);
					yield return null;
				}
			}
			else
			{
				yield return null;
			}
		}
	}
}
